<template>
	<view class="review-box">
		<view class="index-head">
			<!-- <view class="pick-time">
				<view>派单时间：</view>
				<view class="time-box" @click="()=>{show = true}">
					{{time}}
				</view>
			</view> -->
			<view>
				<u-tabs :list="list" :is-scroll="false" :current="current" @change="val=>{current = val}"></u-tabs>
			</view>
		</view>		
		<view class="list-box">
			<confirmed :deliveryTime="deliveryTime" :statusCode="(current+1+'')"/>
		</view>
		<u-picker v-model="show" mode="time" @confirm="getTime"></u-picker>
	</view>
</template>
<script>
	import confirmed from './components/confirmed.vue';	
	export default {
		components:{
			confirmed
		},
		data(){
			return {
				current:0,
				show:false,
				time:'',
				timestamp:null,
				deliveryTime:null,
				list:[{
					name: '待确认'
				},{
					name: '待回店'
				},{
					name: '已到店'
				},{
					name: '取消'
				}]	
			}
		},
		onLoad(){
			let date = new Date()
			this.time = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate()
		},
		methods:{
			getTime(val){
				console.log(val)
				this.time = val.year + '-' + val.month + '-' + val.day 
				this.deliveryTime = val.timestamp
			}
		}
	}
</script>
<style lang="scss" scoped>
	.review-box{
		.index-head{
			width: 100%;
			height: 14vh;
			.pick-time{
				width: 100%;
				height: 120upx;
				background-color: $bg-color;
				display: flex;
				flex-direction: row;
				align-items: center;
				padding: 0 0 0 32upx;
				color: #fff;
				.time-box{
					width: 220upx;
					height: 55upx;
					margin-left: 6upx;
					background-color: rgba(255,255,255,0.4);
					color: #fff;
					display: flex;
					flex-direction: row;
					justify-content: center;
					align-items: center;
					border-radius: 8upx;
				}
			}
		}		
		.list-box{
			width: 100%;
			height: 84vh;
			overflow: hidden;
			overflow-y: scroll;
			// background-color: #000;
		}
	}
	
</style>